Mutant fixation in the presence of a natural enemy

The literature about mutant invasion and fixation typically assumes populations to exist in isolation from their ecosystem. Yet, populations are part of ecological communities, and enemy-victim (e.g. predator-prey or pathogen-host) interactions are particularly common. We use spatially explicit, computational pathogen-host models (with wild-type and mutant hosts) to re-visit the established theory about mutant fixation, where the pathogen equally attacks both wild-type and mutant individuals. Mutant fitness is assumed to be unrelated to infection. We find that pathogen presence substantially weakens selection, increasing the fixation probability of disadvantageous mutants and decreasing it for advantageous mutants. The magnitude of the effect rises with the infection rate. This occurs because infection induces spatial structures, where mutant and wild-type individuals are mostly spatially separated. Thus, instead of mutant and wild-type individuals competing with each other, it is mutant and wild-type “patches” that compete, resulting in smaller fitness differences and weakened selection. This implies that the deleterious mutant burden in natural populations might be higher than expected from traditional theory.

where r and d are respectively the linear growth and death rates of uninfected cells, K is the demes' carrying capacity, β is the infection rate, a is the death rate of infected cells, and µ is the migration rate of cells.Equations (1)(2) describe the version of the model characterized by non-spatial migration, that is, migration happens among all the N patches.To study the nearestneighbor migration, we would replace the term containing µ in equation (1) with and similarly, for equation (2), where {µ ik } is a symmetric migration matrix.
To implement migration to the nearest neighbors, we placed the patches on a square grid with periodic boundary conditions, and set µ ij = µ/8 if patches i and j are neighbors in the Moore neighborhood sense, and µ ij = 0 otherwise.
Here we will describe the Gillespie-type stochastic simulation algorithm that we used to sample trajectories from the mean-field description, by using the example of system (1-2).Our algorithm is one of many possible stochastic methodologies, see e.g.[1] for a review.For convenience, in the stochastic system, let us suppose that the current number of uninfected individuals in patch i is denoted by x i , and the current number of infected individuals in patch i is denoted by z i (these are integer numbers in the stochastic simulation).This way, the various terms in equations (1-2) describe the propensities of all the possible stochastic events.For example, P (i) 1 = dx i is the propensity for a death event of an uninfected individual in patch i, and is the propensity for an infection event in patch i where a single individual becomes infected.For patch i, there are also the following propensities: where [. ..] + stands for the positive part.Let us define the total patch propensity k for 1 ≤ i ≤ N , and the total system propensity as P = N i=1 P (i) .The algorithm proceeds as a sequence of steps.For each step, we first determine which patch is chosen for an updating event.This is done by choosing patch i with probability P (i) /P for each i.Once the updating patch is chosen, we need to determine what update happens.This is done by picking update k with probability P (i) k /P (i) for each k ∈ {1, . . ., 6}.Once the update is chosen, the number of individuals is changed accordingly.For example, if update k = 2 is chosen, then the number of individuals in patch i changes as x i → x i − 1 and z i → z i + 1.Note that if a migration update is chosen (for example, k = 5), then the number of individuals in patch i decreases (x i → x i − 1), and also the number of individuals increases in a randomly chosen patch m (with all patches being equally likely to be picked): x m → x m +1.Finally, we determine the time-increment, that is, the length of time, ∆t, that elapsed between the previous update and the current update.This is done by setting ∆t to be a random number exponentially distributed with the mean 1/P.Note that our algorithm follows the description of Appendix A, Direct Method, in Ref. [1].
Trajectories obtained by using this algorithm are characterized by the mean values approximately given by equations (1-2).
To numerically study mutant fixation in the patch model, a procedure similar to the ABM was followed.Initially, a square block of patches was populated with a number of wild-type, uninfected individuals, and in the middle of that block, a smaller block of patches contained both infected and uninfected, wild-type individuals (the precise numbers used were 30 uninfected individuals per patch, and in addition 10 infected individuals per patch in the infected block).The stochastic algorithm described above was followed until a quasi-equilibrium state was reached, at which point mutant(s) were introduced, as described in the main text.

A coarse-grained description
Let us define an infected patch as a patch that contains at least one infected cell (and it may or may not contain uninfected cells).An uninfected patch contains at least one uninfected cell and no infected cells.Instead of focusing on the dynamics of infected and uninfected cells within patches, we can consider the populations of infected and uninfected patches within the grid, see Supplementary Figure 1.
Supplementary Figure 1: A  Suppose the number of uninfected patches is X, and the number of infected patches is Z.Let us denote the mean number of cells in an uninfected patch as w (X) x ; the mean number of infected cells in an infected patch as w (Z) z , and the mean number of uninfected cells in an infected patch as w (Z) x .We have the following coarse-grained dynamics of patches: Here, the first term in the right hand side of equation ( 3) is the rate at which all the uninfected cells in the system (Xw x ) migrate and land on an empty patch (probability to hit an empty patch is 1 − (X + Z)/N ), which is followed by a successful colonization (probability P col ).The second term in equation ( 3), as well as the first term in equation ( 4), describes the rate at which infected cells (Xw z ) migrate to one of the uninfected patches (probability X/N ), such that takes off (probability P inf ).The last term in equation ( 4) is the rate at which infected patches go extinct, with T ext denoting the mean extinction time of an infected patch.The probability of successful colonization, P col , and the probability of successful infection spread, P inf , can be approximated as follows, Other parameters of system (3-4), such as the mean time of extinction, P ext , and mean population sizes w (X) x , w z , and w x , are calculated from microscopic patch dynamics, as described next.
We will denote by S(t) the number of uninfected cells and by I(t) the number of infected cells in a typical patch.
Uninfected patches.We have, inside the uninfected patches: The life-span of an uninfected patch is defined by the timing of infection, T inf .Infections happen at the rate 1 N µZw (Z) z P inf , so we have The mean population of an uninfected patch is therefore Infected patches.We have, inside the infected patches: The time to extinction, T ext > 0, is approximated by obtaining the time that corresponds to the first minimum of the function I(t).The mean population sizes are then given by Coarse-grained method numerical procedure.The goal is, given all the system parameters, to predict the expected (infected and uninfected) patch numbers and the expected number of (infected and uninfected) individuals inside patches.Solutions (X, Z) of system (3-4), as well as values w (X) x , w z , and w were used to approximate these values.The following steps were implemented: 0) Use an initial guess for the 5 quantities, (X, Z, w 1) Evaluate parameters P inf and T inf , equations (6) and (9).
2) Numerically solve the system for infected patches (equations (11-12)) up to some large value of time, T max .
3) Obtain T ext > 0 by locating the first minimum of the function I(t) in (0, T max ).
4) Numerically solve the system for uninfected patches (equations (7-8)) up to the value T ext .
5) Evaluate the updated values of w (X) x using the solution in 4), equation (10); evaluate the updated values of w (Z) z and w (Z) x using the solution in 2), equations (13-14).6) Perform an iteration of a discretized version of equations (3-4) to find updated values of X, Z: 7) Repeat steps (0-6), until convergence is reached.

Stochastic simulations and coarse-grained predictions
Stochastic Gillespie-type simulations of system (1-2) were performed, as described in Section 1.1.The simulations were initiated by placing a relatively small block of occupied patches in the middle of the grid, with the rest of the patches initially empty.All the occupied patches were uninfected except for a smaller block in the middle.For example, in a 40 × 40 grid, we started with 7 × 7 occupied patches in the middle, of which the central 3 × 3 block was infected.The initial populations of the occupied patches were just below the carrying capacity, and the initial population of infected patches contained a third of infected cells.Simulations of this type were run for a range of migration rate values, µ.Supplementary Figure 2 shows typical dynamics inside a single patch in a multi-patch simulation, under a lower (panel (a)) and a higher (panel (b)) migration rate.
Supplementary For each value of the migration rate, we obtained numerical counts of infected and uninfected patch numbers, as well as the numbers of individuals inside patches, at quasi-equilibrium.To count patch numbers, we assumed that a patch is uninfected if it contains at lest one uninfected individual and no infected individuals; a patch is infected if it contains at least one infected individual.Supplementary Figure 3 shows a comparison of stochastic simulations (dots with vertical bars, representing ensemble means and standard deviations) with the coarse-grained method predictions (dashed lines), for patch numbers (X, Z, see panel (a)) and the numbers of individuals (w x , w 2 Supplementary Note 2: A coarse-grained approach in the presence of mutants 2.1 The patch model in the presence of two types of hosts In the presence of two types of hosts, the dynamics in the patch system are described by the following ODEs, where x i , y i , and z i are respectively the number of uninfected wild-type cells, uninfected mutant cells, and infected cells.The division rates of wild-type and mutant cells are given by r x and r y respectively.The death rates of wild-type and mutant cells are given by d x and d y respectively.It is assumed that while mutants may differ from the wild type cells by their division or death rates, both types of host are equally susceptible to infection (they are characterized by the same infectivity, β), they migrate with the same rate µ, and the death rate of infected cells, a, does not depend on their type.This is a generalization of system (1-2), and was also simulated by using the Gillespie-type algorithm.

A coarse-grained system in the presence of two types of hosts
Let us extend the coarse-grained approach, equations (3-4), to systems with two types of host, wild type and mutant cells.In order for this approach to work, most nonempty patches in the system should be purely wild-type or purely mutant.If a significant fraction of patches contains both types, the approach is not valid (see below for the applicability conditions).Denote by • Conversion of wild-type patches to mutant patches, which also increases the number of mutant patches, with the per-patch rate • Infection of mutant patches, which leads to their subsequent extinction (and decreases their number) at the per-patch rate • Conversion of mutant patches to wild-type patches, which decreases the number of mutant patches with the per-patch rate To better understand the role of these processes in patch selection, we can envisage a corresponding coarse-grained stochastic process, where the number of mutant patches is denoted as j ∈ [0, N ], and during an infinitesimal time, ∆t, the following processes take place: • The number of mutant patches can increase by one with probability P (j → j + 1) = j(ν col + ν x→y )∆t; • The number of mutant patches can decrease by one with probability P (j → j − 1) = j(ν inf + ν y→x )∆t; • The number of mutant patches can remain constant with probability P (j → j) = 1 − (P (j → j + 1) + P (j → j − 1)).
Denote by ρ j the probability that starting from j mutant patches, the system reaches the state where all patches are mutant (j = N ).We have ρ 0 = 0, ρ N = 1, and ρ j = P (j → j+1)ρ j+1 +P (j → j−1)ρ j−1 +ρ j (1−(P (j → j+1)+P (j → j−1))), 0 < j < N, which is equivalent to or, denoting by N inf and N uninf the total expected number of infected and uninfected cells at the mutant-free equilibrium, we have the condition If the process of extinction-recolonization is predominant, then the probability of mutant fixation, starting from a single fully mutant deme, is given by (30)

Comparison with simulations
If the process of conversion is dominant, then we expect the probability of mutant fixation to be similar to that of the Moran process.On the other hand, if the extinction-recolonization process is predominant compared to the conversion process, we expect selection to be significantly weaker and the probability of fixation much larger (smaller) for disadvantageous (advantageous) mutants.
To test this theory, it is instructive to use the parameter regime where the process of extinction-recolonization process is predominant.This is observed when the mutant and wild type cells are typically separated, that is, they do not co-occur in the same demes.Such separation happens for example if many demes are unoccupied (allowing for recolonization by a single type), and when demes' life-span is relatively short (due to intense infection), which precludes accumulation of cells of the different types due to migration.
While spatial separation of mutants and wild-types is typical in simulation with spatially restricted migration, it is more difficult to achieve under non-spatial migration.To increase the degree of separation of mutants and wild types (and thus to amplify the contribution of extinction-recolonization process in the absence of space), we assumed that infected cells migrated at a faster rate than uninfected cells.As a result, demes' lifespans became shorter (due to intense infection) and conversion did not play a significant role.
Supplementary Figure 4 shows a typical result of a stochastic simulation of a non-spatial system where mutant and wild-type cells are largely separated (for a detailed description of the stochastic algorithms used here, see Section 1.1).Mutant individuals were assumed to have a 2% advantage in the division rate.In a simulation run where mutant individuals expand from patches, blue); similarly, in orange, we plot the fraction of mixed patches (that is uninfected patches that contain at least one wild-type and at least one mutant individual).We observe that the fraction of mixed patches stays low as time goes by.Finally, panel (d) shows a histogram of mutant fraction in the uninfected patches.It represents the mutant fractions collected in the course of the simulation, sampled 500 times (after every 10,000 stochastic updates, approximately 1 time unit) during the time-interval depicted in panels (a-c).We can see again that the majority of patches are either 100% mutant or 100% wild-type.
Note that most simulations that start with a low number of mutants will result in mutant extinction without ever seeing a significant number of mutants; for such runs, it is not surprising that most of the patches are homogeneous (and contain wild-type cells).The simulation shown in Supplementary Figure 4 was chosen such that mutants do rise to a significant percentage.It demonstrates that even in such cases, the two types of individuals remain mostly separated (that is, rarely inhabit the same patch).
Supplementary Figure 5: The coarse-grained approach applied to the system in Sup- For this system, we demonstrate that the method described above produces a very good prediction of the mutant fixation probability.Supplementary Figure 5 shows the result of iterations of system (15-16), to obtain patch that contained at least one uninfected cell was selected randomly, and all uninfected cells were replaced by mutant uninfected cells.The simulation was stopped when either the mutants reached fixation or were extinct.This process was repeated 15, 480 times, for each value of s, yielding the fraction of the runs that resulted in mutant fixation.
We observe that the prediction of the coarse-grained approach is very similar to the observed probability of mutant fixation, and that the Moran prediction corresponds to a much higher fixation probability for advantageous mutants.
schematic of the coarse-grained model.(a) Patches can be uninfected, infected, or empty; here green and orange dots denote uninfected and infected cells.(b) An infected patch can become infected after a time, T inf .(c) An infected patch can become extinct after a time, T ext .(d) The coarse-grained description includes these two processes and a process of colonization of empty patches.Here the blue arrows indicate which populations contribute to which rates.

3 :
Comparison of stochastic simulations (dots with vertical bars, showing means and standard deviations), and the coarse-grained method predictions (dashed lines).(a) The numbers of uninfected (blue) and infected (yellow) patches are plotted for different values of the migration rate, µ.(b) The numbers of uninfected individuals in uninfected patches (w (X) x , blue), infected individuals (w (Z) z , yellow), and uninfected individuals in infected patches (w (Z) x , green) are plotted for different values of µ.The rest of the parameters are as in Supplementary Figure 2.

Figure 4 .
Iterations of steps (0-6) of section 1.2 are shown for the deme numbers (a) and population sizes (b).The means and standard deviations obtained by stochastic simulations are shown on the right side of each graph.Parameters are as in Supplementary Figure 4.